var myvue = new Vue({
	el: "body",
	data: {
		name: "",
		pas: "",
		userid: ""
	},
	methods: {
		init: function() {
			var mythis=this;
			alert(mythis.name+"--"+mythis.pas);
			AV.User.logIn(mythis.name,mythis.pas).then(function(loginedUser) {
				//截取url
//				var reg = new RegExp("(^|&)" + "page" + "=([^&]*)(&|$)", "i");
//				var r = window.location.search.substr(1).match(reg);
//				if(r != null) {
//					this.userid = unescape(r[2]);
//					if(unescape(r[2]) == 1) {
//						location.href = "../page2/page2.html";
//					} else if(unescape(r[2]) == 2) {
//						location.href = "../page2/page2b.html";
//					} else if(unescape(r[2]) == 3) {
//						location.href = "../page2/page2c.html";
//					} else if(unescape(r[2]) == 4) {
//						location.href = "../page4/page4.html";
//					}
//				} else {
//					console.log(null);
					location.href = "../index.html";
//				};
			}, function(error) {
				alert("请输入正确的账号与密码");
				alert(error)
			});
		}
	}
})